local zhijin = fk.CreateSkill {
  name = "lingling__zhijin",
}

Fk:loadTranslationTable{
  ["lingling__zhijin"] = "执进",
  [":lingling__zhijin"] = "出牌阶段限一次，你可以视为对一名手牌或体力多于你的其他角色使用【决斗】",

  ["#lingling__zhijin"] = "执进：视为对一名手牌或体力多于你的角色使用【决斗】！",
}

zhijin:addEffect("active", {
  anim_type = "offensive",
  prompt = "#lingling__zhijin",
  card_num = 0,
  target_num = 1,
  can_use = function(self, player)
    return player:usedSkillTimes(zhijin.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    local card = Fk:cloneCard("duel")
    card.skillName = zhijin.name
    return card.skill:modTargetFilter(player, to_select, {}, card) and
      (to_select:getHandcardNum() > player:getHandcardNum() or to_select.hp > player.hp)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:useVirtualCard("duel", nil, player, effect.tos, zhijin.name)
  end,
})

return zhijin
